package com.gg.user.gguser.controller;

import com.gg.user.gguser.service.GgInvitationCodeServe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yangxinlei
 * @date 2020/4/24
 */
@RestController
@RequestMapping("/InvitationCode")
public class GgInvitationCodeController {

    @Autowired
    private GgInvitationCodeServe ggInvitationCodeServe;


    /**
     * 增加邀请码
     */
    @GetMapping("addInvitationCode")
    public Object addInvitationCode(HttpServletResponse response, HttpServletRequest request) throws Exception{
        return ggInvitationCodeServe.addInvitationCode(response, request);
    }

    /**
     * 查询邀请码
     */
    @GetMapping("getInvitationCode")
    public Object getInvitationCode(HttpServletResponse response, HttpServletRequest request) throws Exception{
        return ggInvitationCodeServe.getInvitationCode(response, request);
    }

    /**
     * 查询邀请码归属
     */
    @GetMapping("getInvitationUser")
    public Object getInvitationUser(HttpServletResponse response, HttpServletRequest request,String invitation) throws Exception{
        return ggInvitationCodeServe.getInvitationCode(response, request);
    }

}
